diff options
| author | Adam Soltys <[email protected]> | 2026-02-04 12:42:42 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-02-11 15:34:19 -0800 |
| commit | 78c201d8d9d2f3ec07f6ea36201977846e29ccd9 (patch) | |
| tree | 413d697c2cfa9d3e867c791e161183bad958ed86 /src/routes/(app)/ecash/[id] | |
| parent | 882c3bd3fd01b6001172c61e0d2227d962254c62 (diff) | |
| download | coinos-ui-78c201d8d9d2f3ec07f6ea36201977846e29ccd9.tar.gz coinos-ui-78c201d8d9d2f3ec07f6ea36201977846e29ccd9.zip | |
homepage design and currency toggling
Diffstat (limited to 'src/routes/(app)/ecash/[id]')
| -rw-r--r-- | src/routes/(app)/ecash/[id]/[...version]/+layout.svelte | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/src/routes/(app)/ecash/[id]/[...version]/+layout.svelte b/src/routes/(app)/ecash/[id]/[...version]/+layout.svelte index 530aa126..1f20820c 100644 --- a/src/routes/(app)/ecash/[id]/[...version]/+layout.svelte +++ b/src/routes/(app)/ecash/[id]/[...version]/+layout.svelte @@ -1,6 +1,8 @@ <script> import { copy, sats, f, s } from "$lib/utils"; - import { t } from "$lib/translations"; let { data, children } = $props(); + import { t } from "$lib/translations"; + import { fiat } from "$lib/store"; + let { data, children } = $props(); let { id, user, token, total, spent, external, mint, rate } = data; let currency = user?.currency || "USD"; @@ -18,14 +20,15 @@ {#if amount > 0} <div class="text-center font-bold text-2xl"> - <div> - {f(amountFiat, currency)} - </div> - <div> - <span class="text-secondary font-normal text-xl" - >⚡️{`${s(amount)}`}</span - > - </div> + {#if $fiat} + <div>{f(amountFiat, currency)}</div> + {:else} + <div> + <span class="text-secondary font-normal text-xl" + >⚡️{`${s(amount)}`}</span + > + </div> + {/if} </div> {/if} @@ -36,15 +39,19 @@ {#if spent > 0} <div class="text-center font-bold text-2xl"> - <div> - {f(spentFiat, currency)} - <span class=" text-red-600">{$t("payments.spent")}</span> - </div> - <div> - <span class="text-secondary font-normal text-xl" - >⚡️{`${s(spent)}`}</span - > - </div> + {#if $fiat} + <div> + {f(spentFiat, currency)} + <span class=" text-red-600">{$t("payments.spent")}</span> + </div> + {:else} + <div> + <span class="text-secondary font-normal text-xl" + >⚡️{`${s(spent)}`}</span + > + <span class=" text-red-600">{$t("payments.spent")}</span> + </div> + {/if} </div> {/if} |
